export const emojiList = [
  { id: 'toothlessLaugh', name: '[笑掉牙]', file: 'xiaodiaoya.png' },
  { id: 'cute', name: '[可爱]', file: 'keai.png' },
  { id: 'cool', name: '[冷酷]', file: 'lengku.png' },
  { id: 'shutUp', name: '[闭嘴]', file: 'bizui.png' },
  { id: 'angry', name: '[生气]', file: 'shengqi.png' },
  { id: 'terrified', name: '[惊恐]', file: 'jingkong.png' },
  { id: 'sleepy', name: '[瞌睡]', file: 'keshui.png' },
  { id: 'laugh', name: '[大笑]', file: 'daxiao.png' },
  { id: 'heart', name: '[爱心]', file: 'aixin.png' },
  { id: 'smirk', name: '[坏笑]', file: 'huaixiao.png' },
  { id: 'blowKiss', name: '[飞吻]', file: 'feiwen.png' },
  { id: 'question', name: '[疑问]', file: 'yiwen.png' },
  { id: 'happy', name: '[开心]', file: 'kaixin.png' },
  { id: 'daze', name: '[发呆]', file: 'fadai.png' },
  { id: 'tears', name: '[流泪]', file: 'liulei.png' },
  { id: 'awkward', name: '[汗颜]', file: 'hanyan.png' },
  { id: 'horror', name: '[惊悚]', file: 'jingshu.png' },
  { id: 'tired', name: '[困~]', file: 'kun.png' },
  { id: 'heartBroken', name: '[心碎]', file: 'xinsui.png' },
  { id: 'angel', name: '[天使]', file: 'tianshi.png' },
  { id: 'dizzy', name: '[晕]', file: 'yun.png' },
  { id: 'ah', name: '[啊]', file: 'a.png' },
  { id: 'fury', name: '[愤怒]', file: 'fennu.png' },
  { id: 'asleep', name: '[睡着]', file: 'shuizhuo.png' },
  { id: 'expressionless', name: '[面无表情]', file: 'mianwubiaoqing.png' },
  { id: 'sad', name: '[难过]', file: 'nanguo.png' },
  { id: 'drowsy', name: '[犯困]', file: 'fankun.png' },
  { id: 'yummy', name: '[好吃]', file: 'haochi.png' },
  { id: 'vomit', name: '[呕吐]', file: 'outu.png' },
  { id: 'grin', name: '[龇牙]', file: 'ziya.png' },
  { id: 'confused', name: '[懵比]', file: 'mengbi.png' },
  { id: 'eyeRoll', name: '[白眼]', file: 'baiyan.png' },
  { id: 'starving', name: '[饿死]', file: 'esi.png' },
  { id: 'fierce', name: '[凶]', file: 'xiong.png' },
  { id: 'cold', name: '[感冒]', file: 'ganmao.png' },
  { id: 'sweat', name: '[流汗]', file: 'liuhan.png' },
  { id: 'laughCry', name: '[笑哭]', file: 'xiaoku.png' },
  { id: 'drool', name: '[流口水]', file: 'liukoushui.png' },
  { id: 'embarrassed', name: '[尴尬]', file: 'ganga.png' },
  { id: 'surprised', name: '[惊讶]', file: 'jingya.png' },
  { id: 'shocked', name: '[大惊]', file: 'dajing.png' },
  { id: 'sorry', name: '[不好意思]', file: 'buhaoyisi.png' },
  { id: 'commotion', name: '[大闹]', file: 'danao.png' },
  { id: 'unbelievable', name: '[不可思议]', file: 'bukesiyi.png' },
  { id: 'loveYou', name: '[爱你]', file: 'aini.png' },
  { id: 'redHeart', name: '[红心]', file: 'hongxin.png' },
  { id: 'thumbsUp', name: '[点赞]', file: 'dianzan.png' },
  { id: 'devil', name: '[恶魔]', file: 'emo.png' },
];

export let emojiPage = {};
emojiList.forEach((item, index) => {
  if (!emojiPage[Math.floor(index / 30) + 1]) {
    emojiPage[Math.floor(index / 30) + 1] = [];
  }
  emojiPage[Math.floor(index / 30) + 1].push(item);
});

// Helper function to get emoji name based on current language
import { t } from '@/i18n/solveSetup';

export function getEmojiName(emojiId) {
  const i18nKey = `emoji.${emojiId}`;
  const translatedName = t(i18nKey);

  // Fall back to Chinese name if translation is missing
  if (translatedName === i18nKey) {
    const emoji = emojiList.find(e => e.id === emojiId);
    return emoji ? emoji.name : `[${emojiId}]`;
  }

  return `[${translatedName}]`;
}
